home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / Digital_DreamTripping.lha / DreamTrippingHD / Install-DreamTripping < prev    next >
Text File  |  2001-10-03  |  4KB  |  186 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")            ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #cleanup "")            ;files to delete after install
  6. (set #last-file "")        ;last file the imager should create
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; checks if given program is installed, if not abort install
  11. ; #program - to check
  12.  
  13. (procedure P_ChkRun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort
  18.       (cat
  19.     "You must install \"" #program "\" first!\n"
  20.     "It must be accessible via the path.\n"
  21.     "You can find it in the WHDLoad package."
  22.       )
  23.     )
  24.   )
  25. )
  26. ;****************************
  27.  
  28. (if
  29.   (exists #readme-file)
  30.   (if
  31.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  32.     ("")
  33.     (run ("SYS:Utilities/More %s" #readme-file))
  34.   )
  35. )
  36.  
  37. (set #program "WHDLoad")
  38. (P_ChkRun)
  39.  
  40. (set #program "RawDIC")
  41. (P_ChkRun)
  42.  
  43. (set #program "xfddecrunch")
  44. (P_ChkRun)
  45.  
  46. (if
  47.   (= @user-level 2)
  48.   (
  49.     (set #CI_drive
  50.       (askchoice
  51.     (prompt "Select source drive for diskimages")
  52.     (default 0)
  53.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  54.     (help @askchoice-help)
  55.       )
  56.     )
  57.     (select #CI_drive
  58.       (set #CI_drive "DF0:")
  59.       (set #CI_drive "DF1:")
  60.       (set #CI_drive "DF2:")
  61.       (set #CI_drive "DF3:")
  62.     )
  63.     (set #ignore " IGNOREERRORS")
  64.   )
  65.   (set #CI_drive "DF0:")
  66.   (set #ignore "")
  67. )
  68.  
  69. (set @default-dest
  70.   (askdir
  71.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  72.     (help @askdir-help)
  73.     (default @default-dest)
  74.     (disk)
  75.   )
  76. )
  77. (set #dest (tackon @default-dest @app-name))
  78. (if
  79.   (exists #dest)
  80.   (
  81.     (set #choice
  82.       (askbool
  83.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  84.         (default 1)
  85.         (choices "Delete" "Skip")
  86.         (help @askbool-help)
  87.       )
  88.     )
  89.     (if
  90.       (= #choice 1)
  91.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  92.     )
  93.   )
  94. )
  95. (makedir #dest
  96.   (help @makedir-help)
  97.   (infos)
  98. )
  99.  
  100. ;----------------------------
  101.  
  102. (if
  103.   (exists ("%s.newicon" @app-name))
  104.   (set #icon
  105.     (askchoice
  106.       (prompt "\nWhich icon would you like to install?\n")
  107.       (default 0)
  108.       (choices "Color Icon" "NewIcon")
  109.       (help @askchoice-help)
  110.     )
  111.   )
  112.   (set #icon 0)
  113. )
  114. (select #icon
  115.   (set #icon ("%s.coloricon" @app-name))
  116.   (set #icon ("%s.newicon" @app-name))
  117. )
  118. (copyfiles
  119.   (help @copyfiles-help)
  120.   (source #icon)
  121.   (newname ("%s.info" @app-name))
  122.   (dest #dest)
  123. )
  124. (copyfiles
  125.   (help @copyfiles-help)
  126.   (source ("%s.Slave" @app-name ))
  127.   (dest #dest)
  128. )
  129. (if
  130.   (exists #readme-file)
  131.   (copyfiles
  132.     (help @copyfiles-help)
  133.     (source #readme-file)
  134.     (dest #dest)
  135.   )
  136. )
  137. (if
  138.   (exists ("%s.info" #readme-file))
  139.   (
  140.     (copyfiles
  141.       (help @copyfiles-help)
  142.       (source ("%s.info" #readme-file))
  143.       (dest #dest)
  144.     )
  145.     (tooltype
  146.       (dest (tackon #dest #readme-file))
  147.       (noposition)
  148.     )
  149.   )
  150. )
  151. (if
  152.   (= #sub-dir "")
  153.   ("")
  154.   (
  155.     (set #dest (tackon #dest #sub-dir))
  156.     (makedir #dest
  157.       (help @makedir-help)
  158.     )
  159.   )
  160. )
  161.  
  162. (copyfiles
  163.   (help @copyfiles-help)
  164.   (source ("%s.islave" @app-name))
  165.   (dest #dest)
  166. )
  167.  
  168. (working)
  169. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
  170.  
  171. (if
  172.   (exists (tackon #dest #last-file))
  173.   ("")
  174.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  175. )
  176. (if
  177.   (= 0 (run ("xfddecrunch %s >CON:///1000//CLOSE ALL" #dest)))
  178.   ("")
  179.   (abort "\"xfddecrunch\" has failed to decompress the demo")
  180. )
  181. ;----------------------------
  182.  
  183. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  184.  
  185. (exit)
  186.